#ifndef CLIGHTSHADERCLASS_H
#define CLIGHTSHADERCLASS_H

class CLightShaderClass
{
	struct MatrixBufferType
	{
		D3DXMATRIX d3dWorldMatrix;
		D3DXMATRIX d3dViewMatrix;
		D3DXMATRIX d3dProjectionMatrix;
	};

	struct CameraBufferType
	{
		D3DXVECTOR3 d3dCameraPosition;
		float padding;
	};

	struct LightBufferType
	{
		D3DXVECTOR4 d3dAmbientColor;
		D3DXVECTOR4 d3dDiffuseColor;
		D3DXVECTOR3 d3dLightDirection;
		float fSpecularPower;
		D3DXVECTOR4 d3dSpecularColor;
	};

	ID3D11VertexShader* m_pVertexShader;
	ID3D11PixelShader* m_pPixelShader;
	ID3D11InputLayout* m_pLayout;
	ID3D11SamplerState* m_pSampleState;
	ID3D11Buffer* m_pMatrixBuffer;
	ID3D11Buffer* m_pCameraBuffer;
	ID3D11Buffer* m_pLightBuffer;

	bool InitializeShader(ID3D11Device* pDevice, HWND hWnd, WCHAR* pwszVSLightShaderFileName, WCHAR* pwszPSLightShaderFileName);
	void ShutDownShader();
	void OutputShaderErrorMessage(ID3D10Blob* pErrorMessage, HWND hWnd, WCHAR*);
	bool SetShaderParameters(ID3D11DeviceContext* pDeviceContext, D3DXMATRIX d3dWorld, D3DXMATRIX d3dView, D3DXMATRIX d3dProj, ID3D11ShaderResourceView* pTexture, D3DXVECTOR3 d3dLightDir, D3DXVECTOR4 d3dAmbient, D3DXVECTOR4 d3dDiffuseColor, D3DXVECTOR3 d3dCamPosition, D3DXVECTOR4 d3dSpecularColor, float fSpecularPower); 

public:
	CLightShaderClass(void);
	CLightShaderClass(const CLightShaderClass&);
	~CLightShaderClass(void);

	bool Initialize(ID3D11Device* pDevice, HWND hWnd);
	void ShutDown();
	bool Render(ID3D11DeviceContext* pDeviceContext, int nIndexCount, D3DXMATRIX d3dWorld, D3DXMATRIX d3dView, D3DXMATRIX d3dProj, ID3D11ShaderResourceView* pTexture, D3DXVECTOR3 d3dLightDir, D3DXVECTOR4 d3dAmbient, D3DXVECTOR4 d3dDiffuseColor, D3DXVECTOR3 d3dCamPosition, D3DXVECTOR4 d3dSpecularColor, float fSpecularPower);
	void RenderShader(ID3D11DeviceContext* pDeviceContext, int nIndexCount);

};

#endif